Dynomotion

Group: DynoMotion Message: 877 From: frank_19_88 Date: 1/26/2011
Subject: Test with Mach3Mill
Hey,

Can i run a c-code in Mach3Mill to control my dac out-put without input signals?

I created an 'ini.c' file with Kmotion (see end of this message)

But when i load it into Mach3Mill i get the following massage:
- Dynomotion ok
- But the emergency button flash and give's the fallowing error: Emergency mode active
Do you know what I am doing wrong?

Next week I will receive my encoders they give an A+,A-,B+,B-,0 pont not and 0-point signal.
When I connect them I can find my P, I and D value and update those in the ini.c file.
Do I have to change more values?
Tank you,


ini.c :

#include "KMotionDef.h"
main()
{
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=DAC_SERVO_MODE;
ch0->Vel=4000;
ch0->Accel=40000;
ch0->Jerk=400000;
ch0->P=1;
ch0->I=0;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=1000000;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=0;
ch0->InputChan1=0;
ch0->OutputChan0=0;
ch0->OutputChan1=1;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=20;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=1;
ch0->iir[2].B1=0;
ch0->iir[2].B2=0;
ch0->iir[2].A1=0;
ch0->iir[2].A2=0;
}
Group: DynoMotion Message: 880 From: Tom Kerekes Date: 1/26/2011
Subject: Re: Test with Mach3Mill
Hi Frank,
 
You can't really run servos without position feedback.
What you should do at this point is test your DAC outputs.  On the Console Screen in KMotion type DAC commands such as DAC0=100 and DAC0=-100 does your motor drive slowly forward and then backward?  Be sure all the axes are disabled otherwise the servo will be continuously writing DAC values that will overwrite yours.
 
Mach3 has an EStop input that will cause it to go into Emergency mode.  Mach3 doesn't allow you to disable the EStop input.  But you can configure it to and unused input and change the polarity so Mach3 won't see it.  See Mach3 | Config | Ports & Pins
 
Regards
TK 
 

Group: DynoMotion Message: 884 From: frank_19_88 Date: 1/27/2011
Subject: Re: Test with Mach3Mill
Hello TK,

Tank you for your quick replay,

Yes if I send DAC0=100 it will move forward and DAC0=-100 moves the motor backward.
But if I send DAC0=0 the motor moves very slow forward, when I send DAC0=13 it stands still.

Today I will try to edit the EStop in mach3.
Do you ever help someone true `remote desktop/assistance'?

Thank you,

Frank


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Frank,
>
> You can't really run servos without position feedback.
>
> What you should do at this point is test your DAC outputs.  On the Console
> Screen in KMotion type DAC commands such as DAC0=100 and DAC0=-100 does your
> motor drive slowly forward and then backward?  Be sure all the axes are disabled
> otherwise the servo will be continuously writing DAC values that will overwrite
> yours.
>
> Mach3 has an EStop input that will cause it to go into Emergency mode.  Mach3
> doesn't allow you to disable the EStop input.  But you can configure it to and
> unused input and change the polarity so Mach3 won't see it.  See Mach3 | Config
> | Ports & Pins
>
> Regards
> TK 
>
>
>
>
> ________________________________
> From: frank_19_88 <frank_19_88@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wed, January 26, 2011 6:34:32 AM
> Subject: [DynoMotion] Test with Mach3Mill
>
>  
>
> Hey,
>
> Can i run a c-code in Mach3Mill to control my dac out-put without input signals?
>
> I created an 'ini.c' file with Kmotion (see end of this message)
>
> But when i load it into Mach3Mill i get the following massage:
> - Dynomotion ok
> - But the emergency button flash and give's the fallowing error: Emergency mode
> active
> Do you know what I am doing wrong?
>
> Next week I will receive my encoders they give an A+,A-,B+,B-,0 pont not and
> 0-point signal.
> When I connect them I can find my P, I and D value and update those in the ini.c
> file.
> Do I have to change more values?
> Tank you,
>
> ini.c :
>
> #include "KMotionDef.h"
> main()
> {
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=DAC_SERVO_MODE;
> ch0->Vel=4000;
> ch0->Accel=40000;
> ch0->Jerk=400000;
> ch0->P=1;
> ch0->I=0;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=1000000;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=0;
> ch0->InputChan1=0;
> ch0->OutputChan0=0;
> ch0->OutputChan1=1;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->BacklashMode=BACKLASH_OFF;
> ch0->BacklashAmount=0;
> ch0->BacklashRate=0;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=20;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=1;
> ch0->iir[2].B1=0;
> ch0->iir[2].B2=0;
> ch0->iir[2].A1=0;
> ch0->iir[2].A2=0;
> }
>
Group: DynoMotion Message: 885 From: Tom Kerekes Date: 1/27/2011
Subject: Re: Test with Mach3Mill
Hi Frank,

We only do that as an absolute last resort because it is time consuming.

We like to use tightVNC because it is small, free, allows both sides access to the screen, and because it allows the server (you) to make the connection so you usually don't need to change your router.

http://www.tightvnc.com/

Regarding the DAC commands, some small offset in Kanalog and/or the amplifier input is to be expected.  You can set this offset into the OutputOffset parameter.  But it usually doesn't matter as the servo will correct for any offset to hold position.  Before the servo is enabled it is better to keep the amplifier disabled rather than trying to command exactly zero velocity.

Regards
TK

Group: DynoMotion Message: 886 From: frank_19_88 Date: 1/29/2011
Subject: Re: Test with Mach3Mill
Hi TK,

Thank you,

I found the output Offset at `Config & Flash', but as you told me that's not very important.
I did edit the `Estop' in mach3 to `port2', pin `128', `enable' and `active low' now the error is gone.


But when I put into the ini.c:

ch0->InputMode=ENCODER_MODE;
ch0->OutputMode=CL_STEP_DIR_MODE;

And I start the G-Code in mach3mill it is running true all of the code.(I did connect the kanalog board but didn't connect something to the kanalog board.)

- But shouldn't it wait for the servo till the machine is really in the position?
- The linear encoder's I use are 0,1 um, but can I make a product with 0,1um tolerance?

Regards,

Frank

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Frank,
>
> We only do that as an absolute last resort because it is time consuming.
>
> We like to use tightVNC because it is small, free, allows both sides access to
> the screen, and because it allows the server (you) to make the connection so you
> usually don't need to change your router.
>
> http://www.tightvnc.com/
>
> Regarding the DAC commands, some small offset in Kanalog and/or the amplifier
> input is to be expected. You can set this offset into the OutputOffset
> parameter. But it usually doesn't matter as the servo will correct for any
> offset to hold position. Before the servo is enabled it is better to keep the
> amplifier disabled rather than trying to command exactly zero velocity.
>
>
> Regards
> TK
>
>
>
> ________________________________
> From: frank_19_88 <frank_19_88@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thu, January 27, 2011 3:26:58 AM
> Subject: [DynoMotion] Re: Test with Mach3Mill
>
>
> Hello TK,
>
> Tank you for your quick replay,
>
> Yes if I send DAC0=100 it will move forward and DAC0=-100 moves the motor
> backward.
> But if I send DAC0=0 the motor moves very slow forward, when I send DAC0=13 it
> stands still.
>
> Today I will try to edit the EStop in mach3.
> Do you ever help someone true `remote desktop/assistance'?
>
> Thank you,
>
> Frank
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Frank,
> >
> > You can't really run servos without position feedback.
> >
> > What you should do at this point is test your DAC outputs. On the Console
> > Screen in KMotion type DAC commands such as DAC0=100 and DAC0=-100 does your
> > motor drive slowly forward and then backward? Be sure all the axes are
> >disabled
> >
> > otherwise the servo will be continuously writing DAC values that will
> >overwrite
> >
> > yours.
> >
> > Mach3 has an EStop input that will cause it to go into Emergency mode. Mach3
>
> > doesn't allow you to disable the EStop input. But you can configure it to and
> >
> > unused input and change the polarity so Mach3 won't see it. See Mach3 |
> >Config
> > | Ports & Pins
> >
> > Regards
> > TKÂ
> >
> >
> >
> >
> > ________________________________
> > From: frank_19_88 <frank_19_88@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Wed, January 26, 2011 6:34:32 AM
> > Subject: [DynoMotion] Test with Mach3Mill
> >
> > Â
> >
> > Hey,
> >
> > Can i run a c-code in Mach3Mill to control my dac out-put without input
> >signals?
> >
> > I created an 'ini.c' file with Kmotion (see end of this message)
> >
> > But when i load it into Mach3Mill i get the following massage:
> > - Dynomotionok
> > - But the emergency button flash and give's the fallowing error: Emergency mode
> >
> > active
> > Do you know what I am doing wrong?
> >
> > Next week I will receive my encoders they give an A+,A-,B+,B-,0 pont not and
> > 0-point signal.
> > When I connect them I can find my P, I and D value and update those in the
> >ini.c
> >
> > file.
> > Do I have to change more values?
> > Tank you,
> >
> > ini.c :
> >
> > #include "KMotionDef.h"
> > main()
> > {
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=DAC_SERVO_MODE;
> > ch0->Vel=4000;
> > ch0->Accel=40000;
> > ch0->Jerk=400000;
> > ch0->P=1;
> > ch0->I=0;
> > ch0->D=0;
> > ch0->FFAccel=0;
> > ch0->FFVel=0;
> > ch0->MaxI=200;
> > ch0->MaxErr=1000000;
> > ch0->MaxOutput=200;
> > ch0->DeadBandGain=1;
> > ch0->DeadBandRange=0;
> > ch0->InputChan0=0;
> > ch0->InputChan1=0;
> > ch0->OutputChan0=0;
> > ch0->OutputChan1=1;
> > ch0->MasterAxis=-1;
> > ch0->LimitSwitchOptions=0x0;
> > ch0->InputGain0=1;
> > ch0->InputGain1=1;
> > ch0->InputOffset0=0;
> > ch0->InputOffset1=0;
> > ch0->OutputGain=1;
> > ch0->OutputOffset=0;
> > ch0->SlaveGain=1;
> > ch0->BacklashMode=BACKLASH_OFF;
> > ch0->BacklashAmount=0;
> > ch0->BacklashRate=0;
> > ch0->invDistPerCycle=1;
> > ch0->Lead=0;
> > ch0->MaxFollowingError=1000000000;
> > ch0->StepperAmplitude=20;
> >
> > ch0->iir[0].B0=1;
> > ch0->iir[0].B1=0;
> > ch0->iir[0].B2=0;
> > ch0->iir[0].A1=0;
> > ch0->iir[0].A2=0;
> >
> > ch0->iir[1].B0=1;
> > ch0->iir[1].B1=0;
> > ch0->iir[1].B2=0;
> > ch0->iir[1].A1=0;
> > ch0->iir[1].A2=0;
> >
> > ch0->iir[2].B0=1;
> > ch0->iir[2].B1=0;
> > ch0->iir[2].B2=0;
> > ch0->iir[2].A1=0;
> > ch0->iir[2].A2=0;
> > }
> >
>
Group: DynoMotion Message: 887 From: Tom Kerekes Date: 1/29/2011
Subject: Re: Test with Mach3Mill
Hi Frank,
 
You should first get all the axes working and configured using KMotion.exe before you try to run Mach3.
 
The difference between the commanded destination and the measured position is called the Following Error.  If you set the Max Following Error to a small number then KFlop will disable the axes if the actual motion doesn't follow the commanded motion within that tolerance.
 
Any servo system requires error information in order to make corrections.  If your glass scales have 0.1um resolution then expect the system to require at least a few counts of error so that the servo has some information on the amount of error and more importantly how the error is changing.  If you are lucky and there are no external disturbances the error may eventually settle out to +/- 1 count.  The normal rule of thumb is to have resolution 10X better than your required precision. 
I hope this helps,
Regards
TK